package com.tuanzi.loan.web.lazy.distribution;

import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import org.springframework.data.domain.Page;

import com.tuanzi.loan.vo.request.distribution.DistributionRecordSearchRequest;
import com.tuanzi.loan.vo.response.distribution.GalaxyCardDistributionRecordSearchResponse;
import com.tuanzi.loan.business.service.family.DistributionRecordService;

/**
 * 邀请明细统计 DataModel
 * @author JinRuiyang 2018/2/7 15:34:47
 */
public class DistributionRecordDataModel extends
        BaseLazyDataModel<DistributionRecordSearchRequest, GalaxyCardDistributionRecordSearchResponse> {

    private DistributionRecordService distributionrecordService = SpringContextHolder.getBean(DistributionRecordService.class);

    public DistributionRecordDataModel(DistributionRecordSearchRequest searchRequest) {
        super(searchRequest);
    }

    @Override
    protected Page<GalaxyCardDistributionRecordSearchResponse> doLoad(PageSearcher<DistributionRecordSearchRequest> pageSearcher) {
        return distributionrecordService.list(pageSearcher);
    }
}
